import 'package:json_annotation/json_annotation.dart';

part 'stageinfo.g.dart';

@JsonSerializable()
class CheckpointStageInfo {
  final StageBasics stageBasics;
  final String awardDesc;
  final List<AwardList> awardList;

  CheckpointStageInfo({this.stageBasics, this.awardDesc, this.awardList});

  factory CheckpointStageInfo.fromJson(Map<String, dynamic> json) =>
      _$CheckpointStageInfoFromJson(json);

  Map<String, dynamic> toJson() => _$CheckpointStageInfoToJson(this);
}

@JsonSerializable()
class StageBasics {
  final ConfigInfo configInfo;
  final UsrInfo usrInfo;

  StageBasics({this.configInfo, this.usrInfo});

  factory StageBasics.fromJson(Map<String, dynamic> json) =>
      _$StageBasicsFromJson(json);

  Map<String, dynamic> toJson() => _$StageBasicsToJson(this);
}

@JsonSerializable()
class AwardList {
  final String itemName;
  final String pic;
  final int count;

  AwardList({this.itemName, this.pic, this.count});

  factory AwardList.fromJson(Map<String, dynamic> json) =>
      _$AwardListFromJson(json);

  Map<String, dynamic> toJson() => _$AwardListToJson(this);
}

@JsonSerializable()
class ConfigInfo {
  final String stageId;
  final String dungeonId;
  final String bossname;
  final int dailynum;
  final int vipnum;
  final int vitality;
  final String desc;

  ConfigInfo(
      {this.stageId,
      this.dungeonId,
      this.bossname,
      this.dailynum,
      this.vipnum,
      this.vitality,
      this.desc});

  factory ConfigInfo.fromJson(Map<String, dynamic> json) =>
      _$ConfigInfoFromJson(json);

  Map<String, dynamic> toJson() => _$ConfigInfoToJson(this);
}

@JsonSerializable()
class UsrInfo {
  final int leftNum;
  final StageGrade stageGrade;

  UsrInfo({this.leftNum, this.stageGrade});

  factory UsrInfo.fromJson(Map<String, dynamic> json) =>
      _$UsrInfoFromJson(json);

  Map<String, dynamic> toJson() => _$UsrInfoToJson(this);
}

@JsonSerializable()
class StageGrade {
  final int grade;
  final int score;

  StageGrade({this.grade, this.score});

  factory StageGrade.fromJson(Map<String, dynamic> json) =>
      _$StageGradeFromJson(json);

  Map<String, dynamic> toJson() => _$StageGradeToJson(this);
}
